<!-- build time:Wed Apr 23 2025 13:16:13 GMT+0800 (中国标准时间) --><!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2"><meta name="theme-color" content="#222"><meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1"><meta name="renderer" content="webkit"><link rel="icon" type="image/ico" sizes="32x32" href="/assets/favicon.ico"><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="alternate" href="/rss.xml" title="LinuxSre云原生" type="application/rss+xml"><link rel="alternate" href="/atom.xml" title="LinuxSre云原生" type="application/atom+xml"><link rel="alternate" type="application/json" title="LinuxSre云原生" href="http://blog.zhanglongfei.cloud/feed.json"><link rel="preconnect" href="https://s4.zstatic.net"><link rel="preconnect" href="https://at.alicdn.com"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Mulish:400,400italic,700,700italic%7CFredericka%20the%20Great:400,400italic,700,700italic%7CNoto%20Serif%20JP:400,400italic,700,700italic%7CNoto%20Serif%20SC:400,400italic,700,700italic%7CInconsolata:400,400italic,700,700italic&display=swap&subset=latin,latin-ext" media="none" onload="this.media&#x3D;&#39;all&#39;"><link rel="stylesheet" href="/css/app.css?v=0.4.17"><link rel="modulepreload" href="/js/chunk-CFZVTM5E.js"><link rel="modulepreload" href="/js/chunk-DSDDCHK4.js"><link rel="modulepreload" href="/js/chunk-GPV6MJAR.js"><link rel="modulepreload" href="/js/chunk-H5G2FCYC.js"><link rel="modulepreload" href="/js/chunk-WVP4CIHH.js"><link rel="modulepreload" href="/js/copy-tex-BNTCTEYN.js"><link rel="modulepreload" href="/js/index.esm-5WR6FBAT.js"><link rel="modulepreload" href="/js/post-ERM2LZ6P.js"><link rel="modulepreload" href="/js/quicklink-U3YMDO3L.js"><link rel="modulepreload" href="/js/search-NVSEMC4Y.js"><link rel="modulepreload" href="/js/siteInit.js"><link rel="modulepreload" href="/js/tcomments-OCTPMCAB.js"><link rel="preload" href="https://tva3.sinaimg.cn/large/6833939bly1giciszlczyj20zk0m816d.jpg" as="image" fetchpriority="high"><link rel="preload" href="https://tva3.sinaimg.cn/large/6833939bly1gicis081o9j20zk0m8dmr.jpg" as="image" fetchpriority="high"><link rel="preload" href="https://tva3.sinaimg.cn/large/6833939bly1gicit4jrvuj20zk0m8785.jpg" as="image" fetchpriority="high"><link rel="preload" href="https://tva3.sinaimg.cn/large/6833939bly1gicitcxhpij20zk0m8hdt.jpg" as="image" fetchpriority="high"><link rel="preload" href="https://tva3.sinaimg.cn/large/6833939bly1gicit31ffoj20zk0m8naf.jpg" as="image" fetchpriority="high"><link rel="preload" href="https://tva3.sinaimg.cn/large/6833939bly1giciryrr3rj20zk0m8nhk.jpg" as="image" fetchpriority="high"><meta name="keywords" content="Hexo项目自动部署"><meta name="description" content="这是一个LinuxSre相关的技术博客"><link rel="canonical" href="http://blog.zhanglongfei.cloud/posts/3061789372.html"><title>Hexo项目自动部署</title><meta name="generator" content="Hexo 7.3.0"></head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">Hexo项目自动部署</h1><div class="meta"><span class="item" title="创建时间：2025-04-22 23:58:00"><span class="icon"><i class="ic i-calendar"></i></span><span class="text">发表于</span><time itemprop="dateCreated datePublished" datetime="2025-04-22T23:58:00+08:00">2025-04-22</time></span><span class="item" title="本文字数"><span class="icon"><i class="ic i-pen"></i></span><span class="text">本文字数</span><span>14k</span><span class="text">字</span></span><span class="item" title="阅读时长"><span class="icon"><i class="ic i-clock"></i></span><span class="text">阅读时长</span><span>13 分钟</span></span></div></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span><span class="line"></span><span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">hexo-blog</a></li></ul><ul class="right" id="rightNav"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div class="pjax" id="imgs"><ul><li class="item" style="background-image:url(&quot;https://tva3.sinaimg.cn/large/6833939bly1giciszlczyj20zk0m816d.jpg&quot;)"></li><li class="item" style="background-image:url(&quot;https://tva3.sinaimg.cn/large/6833939bly1gicis081o9j20zk0m8dmr.jpg&quot;)"></li><li class="item" style="background-image:url(&quot;https://tva3.sinaimg.cn/large/6833939bly1gicit4jrvuj20zk0m8785.jpg&quot;)"></li><li class="item" style="background-image:url(&quot;https://tva3.sinaimg.cn/large/6833939bly1gicitcxhpij20zk0m8hdt.jpg&quot;)"></li><li class="item" style="background-image:url(&quot;https://tva3.sinaimg.cn/large/6833939bly1gicit31ffoj20zk0m8naf.jpg&quot;)"></li><li class="item" style="background-image:url(&quot;https://tva3.sinaimg.cn/large/6833939bly1giciryrr3rj20zk0m8nhk.jpg&quot;)"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"></path></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"></use><use xlink:href="#gentle-wave" x="48" y="3"></use><use xlink:href="#gentle-wave" x="48" y="5"></use><use xlink:href="#gentle-wave" x="48" y="7"></use></g></svg></div><main><div class="inner"><div class="pjax" id="main"><div class="article wrap"><div class="breadcrumb" itemlistelement itemscope itemtype="https://schema.org/BreadcrumbList"><i class="ic i-home"></i><span><a href="/">首页</a></span><i class="ic i-angle-right"></i><span class="current" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a href="/categories/Hexo/" itemprop="item" rel="index" title="分类于Hexo"><span itemprop="name">Hexo<meta itemprop="position" content="0"></span></a></span></div><article class="post block" itemscope itemtype="http://schema.org/Article" lang="zh-CN"><link itemprop="mainEntityOfPage" href="http://blog.zhanglongfei.cloud/posts/3061789372.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="image" content="/assets/avatar.jpg"><meta itemprop="name" content="LinuxLearner"><meta itemprop="description" content=", 这是一个LinuxSre相关的技术博客"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="LinuxSre云原生"></span><div class="body md" itemprop="articleBody"><h1 id="font-stylecolor1dc0c9hexo项目自动部署font"><a class="anchor" href="#font-stylecolor1dc0c9hexo项目自动部署font">#</a> <font style="color:#1DC0C9">Hexo 项目自动部署</font></h1><h2 id="font-stylecolor1dc0c9部署hexo至githubpages步骤font"><a class="anchor" href="#font-stylecolor1dc0c9部署hexo至githubpages步骤font">#</a> <font style="color:#1DC0C9">部署 Hexo 至 GithubPages 步骤</font></h2><p><font style="color:#DF2A3F">GitHubPages</font><font style="color:#DF2A3F">可以免费托管</font><font style="color:#DF2A3F">Hexo</font><font style="color:#DF2A3F">博客项目</font>。以下是具体实现步骤：</p><ul><li><p>1. 登录 <code>Github</code> ，创建一个仓库，名称必须为 <code>username.github.io</code> 将 <code>username</code> 替换为你的 GitHub 用户名。（ <font style="color:#DF2A3F">longfeizhang163/longfeizhang163.github.io </font>）</p></li><li><p>2. 安装 <code>hexo-deployer-git</code> 插件，这样才能将 Hexo 的静态资源部署到 GitHub Pages。</p></li><li><p>3. 编辑 Hexo 项目的 <code>_config-yml</code> 文件，修改 <code>deploy</code> 部署相关参数。</p></li><li><p>4. 执行 Hexo 部署命令，稍等片刻即可通过 <font style="color:#DF2A3F">username.github.io</font>访问对应网站。</p></li></ul><h2 id="font-stylecolor1dc0c9部署hexo至githubpages实战font"><a class="anchor" href="#font-stylecolor1dc0c9部署hexo至githubpages实战font">#</a> <font style="color:#1DC0C9">部署 Hexo 至 GithubPages 实战</font></h2><p>1. 登录 Github 创建仓库，仓库名称为 <font style="color:#DF2A3F">longfeizhang163.github.io</font></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222318906.png" alt="image-20250422231825619"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222318803.png" alt="image-20250422231856643"></p><p>2. 配置 Windows 与 Github 免密登录</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>$ ssh-keygen.exe      <span class="token comment"># 生成密钥对</span></pre></td></tr><tr><td data-num="2"></td><td><pre>Generating public/private ed25519 key pair.</pre></td></tr><tr><td data-num="3"></td><td><pre>Enter <span class="token function">file</span> <span class="token keyword">in</span> <span class="token function">which</span> to save the key <span class="token punctuation">(</span>/c/Users/Administrator/.ssh/id_ed25519<span class="token punctuation">)</span>:</pre></td></tr><tr><td data-num="4"></td><td><pre>Created directory <span class="token string">'/c/Users/Administrator/.ssh'</span><span class="token builtin class-name">.</span></pre></td></tr><tr><td data-num="5"></td><td><pre>Enter passphrase <span class="token punctuation">(</span>empty <span class="token keyword">for</span> no passphrase<span class="token punctuation">)</span>:</pre></td></tr><tr><td data-num="6"></td><td><pre>Enter same passphrase again:</pre></td></tr><tr><td data-num="7"></td><td><pre>Your identification has been saved <span class="token keyword">in</span> /c/Users/Administrator/.ssh/id_ed25519</pre></td></tr><tr><td data-num="8"></td><td><pre>Your public key has been saved <span class="token keyword">in</span> /c/Users/Administrator/.ssh/id_ed25519.pub</pre></td></tr><tr><td data-num="9"></td><td><pre>The key fingerprint is:</pre></td></tr><tr><td data-num="10"></td><td><pre>SHA256:jFup6j3QvGDFZkxBJa2G4dgBhEPVlCWG4Rsdt/x10/k Administrator@DESKTOP-EI2RJTM</pre></td></tr><tr><td data-num="11"></td><td><pre>The key's randomart image is:</pre></td></tr><tr><td data-num="12"></td><td><pre>+--<span class="token punctuation">[</span>ED25519 <span class="token number">256</span><span class="token punctuation">]</span>--+</pre></td></tr><tr><td data-num="13"></td><td><pre><span class="token operator">|</span>.++<span class="token operator">+=</span>***.        <span class="token operator">|</span></pre></td></tr><tr><td data-num="14"></td><td><pre><span class="token operator">|</span>o <span class="token punctuation">..</span><span class="token operator">=</span>o*.o     <span class="token builtin class-name">.</span> <span class="token builtin class-name">.</span><span class="token operator">|</span></pre></td></tr><tr><td data-num="15"></td><td><pre><span class="token operator">|</span> <span class="token builtin class-name">.</span> * O +   <span class="token builtin class-name">.</span> o o <span class="token operator">|</span></pre></td></tr><tr><td data-num="16"></td><td><pre><span class="token operator">|</span>  <span class="token builtin class-name">.</span> * Oo<span class="token punctuation">..</span>. <span class="token builtin class-name">.</span> <span class="token builtin class-name">.</span> <span class="token builtin class-name">.</span><span class="token operator">|</span></pre></td></tr><tr><td data-num="17"></td><td><pre><span class="token operator">|</span>   <span class="token builtin class-name">.</span> B. S.      E<span class="token operator">|</span></pre></td></tr><tr><td data-num="18"></td><td><pre><span class="token operator">|</span>    + o+         <span class="token operator">|</span></pre></td></tr><tr><td data-num="19"></td><td><pre><span class="token operator">|</span>   <span class="token builtin class-name">.</span> oo.         <span class="token operator">|</span></pre></td></tr><tr><td data-num="20"></td><td><pre><span class="token operator">|</span>     oo          <span class="token operator">|</span></pre></td></tr><tr><td data-num="21"></td><td><pre><span class="token operator">|</span>   .o <span class="token punctuation">..</span>         <span class="token operator">|</span></pre></td></tr><tr><td data-num="22"></td><td><pre>+----<span class="token punctuation">[</span>SHA256<span class="token punctuation">]</span>-----+</pre></td></tr><tr><td data-num="23"></td><td><pre></pre></td></tr><tr><td data-num="24"></td><td><pre>$ <span class="token function">cat</span> /c/Users/Administrator/.ssh/id_ed25519.pub   <span class="token comment"># 将公钥的内容复制到 Github 的 SSH keys 中完成免密登录</span></pre></td></tr><tr><td data-num="25"></td><td><pre>ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOZAI3DEbRARkCyQWy6d0k3YmFnuLl8qm/U1x3/pBBTf Administrator@DESKTOP-EI2RJTM</pre></td></tr></table></figure><p><font style="color:#191b1f">1. 点击 GitHub 中设置标签，然后点击 </font><strong><font style="color:#191b1f">SSH and GPG keys</font></strong><font style="color:#191b1f"> 、 </font><strong><font style="color:#191b1f">New SSH key</font></strong><font style="color:#191b1f"> 将复制好的链接粘贴进去</font></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222320319.png" alt="image-20250422232010108"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222320659.png" alt="image-20250422232051473"></p><p>2. 检查是否设置成功</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>$ <span class="token function">ssh</span> <span class="token parameter variable">-T</span> git@github.com</pre></td></tr><tr><td data-num="2"></td><td><pre>The authenticity of <span class="token function">host</span> <span class="token string">'github.com (140.82.113.4)'</span> can<span class="token string">'t be established.</span></pre></td></tr><tr><td data-num="3"></td><td><pre>ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.</pre></td></tr><tr><td data-num="4"></td><td><pre>This key is not known by any other names.</pre></td></tr><tr><td data-num="5"></td><td><pre>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes</pre></td></tr><tr><td data-num="6"></td><td><pre>Warning: Permanently added 'github.com<span class="token string">' (ED25519) to the list of known hosts.</span></pre></td></tr><tr><td data-num="7"></td><td><pre>Hi longfeizhang163! You've successfully authenticated, but GitHub does not provide shell access.</pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre>Administrator@DESKTOP-EI2RJTM MINGW64 /e/hexo-blog</pre></td></tr><tr><td data-num="10"></td><td><pre>$ <span class="token function">ssh</span> <span class="token parameter variable">-T</span> git@github.com</pre></td></tr><tr><td data-num="11"></td><td><pre>Hi longfeizhang163<span class="token operator">!</span> You've successfully authenticated, but GitHub does not provide shell access.</pre></td></tr></table></figure><p>3. 安装插件</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token function">npm</span> <span class="token function">install</span> hexo-deployer-git <span class="token parameter variable">--save</span></pre></td></tr></table></figure><p>4. 编辑 <code>_config- yml</code> (示例值如下所示)</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment">#找到配置文件里面这块改成下面内容</span></pre></td></tr><tr><td data-num="2"></td><td><pre>deploy:</pre></td></tr><tr><td data-num="3"></td><td><pre>  type: <span class="token string">''</span></pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment">#改成下面内容</span></pre></td></tr><tr><td data-num="6"></td><td><pre>deploy:</pre></td></tr><tr><td data-num="7"></td><td><pre>  type: <span class="token string">'git'</span></pre></td></tr><tr><td data-num="8"></td><td><pre>  repo: git@github.com:longfeizhang163/longfeizhang163.github.io.git</pre></td></tr><tr><td data-num="9"></td><td><pre>  branch: main</pre></td></tr><tr><td data-num="10"></td><td><pre>  message: deploy</pre></td></tr></table></figure><p>5. 执行部署动作</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token function">git</span> config <span class="token parameter variable">--global</span> user.email <span class="token string">"longfeizhang@example.com"</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token function">git</span> config <span class="token parameter variable">--global</span> user.name <span class="token string">"longfeizhang"</span></pre></td></tr><tr><td data-num="3"></td><td><pre></pre></td></tr><tr><td data-num="4"></td><td><pre>hexo clean <span class="token operator">&amp;&amp;</span> hexo generate <span class="token operator">&amp;&amp;</span> hexo deploy</pre></td></tr></table></figure><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222322960.png" alt="image-20250422232250812"></p><p>6. 测试访问地址 <a target="_blank" rel="noopener" href="https://longfeizhang163.github.io/">https://longfeizhang163.github.io/</a></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222323868.png" alt="image-20250422232330420"></p><h2 id="font-stylecolor1dc0c9为github项目配置自定义域名font"><a class="anchor" href="#font-stylecolor1dc0c9为github项目配置自定义域名font">#</a> <font style="color:#1DC0C9">为 Github 项目配置自定义域名</font></h2><p>如果 Github Pages 需要使用自定义域名，通过如下几步即可完成。</p><p>1. 配置 blog.zhanglongfei.cloud --&gt;CNAME 到 <a target="_blank" rel="noopener" href="https://longfeizhang163.github.io/">longfeizhang163.github.io</a></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222326595.png" alt="image-20250422232612288"></p><p>2. 在 source 目录下创建一个 <code>CNAME</code> 的文件，内容填写自定义域名 blog.zhanglongfei.cloud 。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token function">cat</span> /e/hexo-blog/source/CNAME</pre></td></tr><tr><td data-num="2"></td><td><pre>blog.zhanglongfei.cloud</pre></td></tr></table></figure><p>3. 使用 <code>hexo deploy</code> 将 <code>CNAME</code> 文件一并推送至部署分支。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>hexo clean <span class="token operator">&amp;&amp;</span> hexo generate <span class="token operator">&amp;&amp;</span> hexo deploy</pre></td></tr></table></figure><p>4. 使用自定义域名访问网站 <a href="https://blog.zhanglongfei.cloud/">https://blog.zhanglongfei.cloud/</a></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222326486.png" alt="image-20250422232655741"></p><h2 id="font-stylecolor1dc0c9为自定义域名启用httpsfont"><a class="anchor" href="#font-stylecolor1dc0c9为自定义域名启用httpsfont">#</a> <font style="color:#1DC0C9">为自定义域名启用 https</font></h2><p>1. 登录 GitHub，进入你的仓库。打开 Settings - - &gt;Pages。在 Custom domain 部分，<font style="color:#DF2A3F">勾选 Enforce HTTPS , 表示强制启用 HTTPS 。</font></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222327846.png" alt="image-20250422232751626"></p><p>2. 使用 https 协议访问网站测试 <a href="https://blog.zhanglongfei.cloud/">https://blog.zhanglongfei.cloud/</a></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222328095.png" alt="image-20250422232846753"></p><h1 id="font-stylecolor1dc0c9部署hexo项目至linuxfont"><a class="anchor" href="#font-stylecolor1dc0c9部署hexo项目至linuxfont">#</a> <font style="color:#1DC0C9">部署 Hexo 项目至 Linux</font></h1><h2 id="font-stylecolor1dc0c9部署hexo项目至linux介绍font"><a class="anchor" href="#font-stylecolor1dc0c9部署hexo项目至linux介绍font">#</a> <font style="color:#1DC0C9">部署 Hexo 项目至 Linux 介绍</font></h2><p>除了将 Hexo 博客部署到 GitHub Pages，也可以将博客部署到自建的 Linux 服务器上。常用的部署插件有如下两种：</p><ul><li>1.<strong>hexo-deployer-rsync</strong>：通过 <code>Rsync</code> 实现文件同步。</li><li>2.<strong>hexo-deployer-sftp</strong>：通过 <code>SFTP</code> 协议实现文件上传。</li></ul><p>rsync 比较适用于 Linux 类系统，在 Windows 环境下使用时可能会遇到如下两个问题：</p><ul><li><p>1.<strong> 需要额外安装 Rsync 客户端</strong>：Windows 原生不支持 rsync，需要手动安装相关工具，相对麻烦。</p></li><li><p>2.<strong> 径兼容性问题</strong>：Windows 的路径格式（如 C:\path\to\dir ）与 rsync 的路径格式存在较大差异，会导致命令执行失败。</p></li></ul><p>因此，如果使用的是 Windows 系统编写播客并推送文章，推荐使用 <strong>hexo-deployer-sftp</strong> 插件来实现部署功能。</p><h2 id="font-stylecolor1dc0c9部署hexo项目至linux实战font"><a class="anchor" href="#font-stylecolor1dc0c9部署hexo项目至linux实战font">#</a> <font style="color:#1DC0C9">部署 Hexo 项目至 Linux 实战</font></h2><p>1. 登录 Linux 主机，安装并配置 Nginx</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment"># 1.13.187.120   公网 ip</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># yum install -y nginx</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># vim /etc/nginx/conf.d/test.zhanglongfei.cloud.conf</span></pre></td></tr><tr><td data-num="5"></td><td><pre></pre></td></tr><tr><td data-num="6"></td><td><pre>server <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="7"></td><td><pre>  listen <span class="token number">80</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="8"></td><td><pre>  server_name test.zhanglongfei.cloud<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="9"></td><td><pre>  location / <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="10"></td><td><pre>    root /code/test-zhanglongfei-cloud<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="11"></td><td><pre>    index index.html<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="12"></td><td><pre>  <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="13"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="14"></td><td><pre></pre></td></tr><tr><td data-num="15"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># nginx -t</span></pre></td></tr><tr><td data-num="16"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># mkdir -p /code/test-zhanglongfei-cloud</span></pre></td></tr><tr><td data-num="17"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># systemctl enable nginx --now</span></pre></td></tr><tr><td data-num="18"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># systemctl reload nginx.service</span></pre></td></tr></table></figure><p>2. 为项目安装 <code>hexo-deployer-sftp</code> 插件</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token function">npm</span> <span class="token function">install</span> hexo-deployer-sftp <span class="token parameter variable">--save</span></pre></td></tr></table></figure><p>3. 配置域名解析 A 记录</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222333303.png" alt="image-20250422233355860">4. 这时候访问测试 <a target="_blank" rel="noopener" href="http://test.zhanglongfei.cloud/">http://test.zhanglongfei.cloud/</a> 注意是 http 访问</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222334974.png" alt="image-20250422233418612">5. 编辑 <code>_config.yml</code> 配置文件</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment"># 把之前的往 github 上推送的注释掉</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token comment">#deploy:</span></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token comment">#  type: 'git'</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment">#  repo: git@github.com:longfeizhang163/longfeizhang163.github.io.git</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment">#  branch: main</span></pre></td></tr><tr><td data-num="6"></td><td><pre><span class="token comment">#  message: deploy</span></pre></td></tr><tr><td data-num="7"></td><td><pre></pre></td></tr><tr><td data-num="8"></td><td><pre><span class="token comment"># 部署到 Linux</span></pre></td></tr><tr><td data-num="9"></td><td><pre>deploy:</pre></td></tr><tr><td data-num="10"></td><td><pre>  type: <span class="token function">sftp</span></pre></td></tr><tr><td data-num="11"></td><td><pre>  host: zhanglongfei.cloud   <span class="token comment">#远程服务器地址 (可以写公网 IP 或域名 注意域名能解析到对应公网 ip 才行)</span></pre></td></tr><tr><td data-num="12"></td><td><pre>  port: <span class="token number">22</span></pre></td></tr><tr><td data-num="13"></td><td><pre>  user: root</pre></td></tr><tr><td data-num="14"></td><td><pre>  pass: <span class="token string">"SsvbUAT!@3S1s2vb"</span>					<span class="token comment"># 远端服务器密码</span></pre></td></tr><tr><td data-num="15"></td><td><pre>  <span class="token comment">#privateKey             # 私钥仅支持 PEM 格式，新版 OpenSSH 是 Ed25519 格式不支持，官方也不考虑修复</span></pre></td></tr><tr><td data-num="16"></td><td><pre>  remotePath: /code/test-zhanglongfei-cloud	<span class="token comment"># 推送至远程服务器的哪个路径下</span></pre></td></tr><tr><td data-num="17"></td><td><pre>  forceUpload: <span class="token boolean">true</span>             <span class="token comment"># 远端服务器内容必须与本地保持一致</span></pre></td></tr></table></figure><p>6. 执行部署动作</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>hexo clean <span class="token operator">&amp;&amp;</span> hexo generate <span class="token operator">&amp;&amp;</span> hexo deploy</pre></td></tr></table></figure><p>7. 访问 <a target="_blank" rel="noopener" href="http://test.zhanglongfei.cloud/">http://test.zhanglongfei.cloud/</a></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222337531.png" alt="image-20250422233705300"></p><p>8. 这种部署存在的问题</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222337998.png" alt="image-20250422233727838"></p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment"># URL 美化</span></pre></td></tr><tr><td data-num="2"></td><td><pre>url: http://zhanglongfei.cloud</pre></td></tr><tr><td data-num="3"></td><td><pre></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment">#改成如下内容</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment"># URL 美化</span></pre></td></tr><tr><td data-num="6"></td><td><pre>url: http://test.zhanglongfei.cloud</pre></td></tr></table></figure><p>9. 再次查看分享的域名问题</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222337813.png" alt="image-20250422233754302"></p><h1 id="font-stylecolor1dc0c9hexo项目接入cdn加速服务font"><a class="anchor" href="#font-stylecolor1dc0c9hexo项目接入cdn加速服务font">#</a> <font style="color:#1DC0C9">Hexo 项目接入 CDN 加速服务</font></h1><h2 id="font-stylecolor1dc0c9为何需要接入cdnfont"><a class="anchor" href="#font-stylecolor1dc0c9为何需要接入cdnfont">#</a> <font style="color:#1DC0C9">为何需要接入 CDN</font></h2><p>无论网站托管在 <font style="color:#DF2A3F">GitHubPages</font> 还是自建的 <font style="color:#DF2A3F">Linux</font> 节点，直接访问源站可能会出现以下问题：</p><ul><li><strong>1. 访问速度慢</strong>：用户请求直接到达源站，受限于源站的物理位置和带宽限</li></ul><p>制。</p><ul><li><strong>2. 延迟高</strong>：跨地域访问会增加网络延迟，导致访问体验不佳。</li><li><strong>3. 服务器负载高</strong>：突发流量可能导致源站超负荷，甚至服务中断。</li></ul><p>为了解决这些问题，可以接入 CDN 服务。CDN 通过全球分布的节点来缓存网站资源，将用户的请求路由到距离最近的 CDN 节点，从而实现如下效果：</p><ul><li><p>**1. 加速访问：** 减少跨地域传输时间，提升加载速度。</p></li><li><p>**2. 降低源站压力：** 将大部分静态资源缓存到 CDN 节点，减少源站的直接访问量。</p></li><li><p>**3. 提高稳定性：** 分散流量，防止单点压力过大。</p></li></ul><h2 id="font-stylecolor1dc0c9自托管linux接入cdn流程font"><a class="anchor" href="#font-stylecolor1dc0c9自托管linux接入cdn流程font">#</a> <font style="color:#1DC0C9">自托管 Linux 接入 CDN 流程</font></h2><p>网站接入 CDN 加速前访问流程：用户 - - &gt; test.zhanglongfei.cloud--&gt; 源站</p><p>网站接入 CDN 加速后访问流程：<strong><font style="color:#DF2A3F">用户 --&gt; test.zhanglongfei.cloud --&gt; CNAME --&gt; CDN 节点 --&gt; 源站</font></strong></p><h2 id="font-stylecolor1dc0c9githubpage接入cdn流程font"><a class="anchor" href="#font-stylecolor1dc0c9githubpage接入cdn流程font">#</a> <font style="color:#1DC0C9">GithubPage 接入 CDN 流程</font></h2><p>网站接入 CDN 加速前访问流程：用户 - - &gt; blog.zhanglongfei.cloud &gt;CNAME --&gt; <a target="_blank" rel="noopener" href="http://longfeizhang163.github.io">longfeizhang163.github.io</a> (源站)</p><p>网站接入 CDN 加速后访问流程：<strong><font style="color:#DF2A3F">用户 --&gt; blog.zhanglongfei.cloud --&gt; CNAME --&gt; CDN 节点 --&gt; CNAME --&gt; <a target="_blank" rel="noopener" href="http://longfeizhang163.github.io">longfeizhang163.github.io</a> (源站)</font></strong></p><h2 id="font-stylecolor1dc0c9配置网站接入cdn加速服务font"><a class="anchor" href="#font-stylecolor1dc0c9配置网站接入cdn加速服务font">#</a> <font style="color:#1DC0C9">配置网站接入 CDN 加速服务</font></h2><p>1. 创建 CDN 服务，域名管理 --&gt; 添加域名</p><ul><li>加速域名：test.zhanglongfei.cloud</li></ul><ul><li>业务类型：图片小文件</li><li>源站信息：<ul><li>自托管 Linux 主机：源站类型为 IP，源站地址为公网服务器的地址</li><li>GithubPage 配置：源站类型为源站域名（ <strong><a target="_blank" rel="noopener" href="http://longfeizhang163.github.io">longfeizhang163.github.io</a></strong> )</li></ul></li></ul><p><strong><font style="color:#DF2A3F">1. 配置自托管 Linux 主机截图如下 (有云服务器)</font></strong></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222341004.png" alt="image-20250422234120761"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222341083.png" alt="image-20250422234135927"></p><p>创建完成后会提供一个 CDN 会提供一个 CNAME 的记录值。</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222342411.png" alt="image-20250422234202849"></p><p><font style="color:#262626">配置域名解析，将原先域名的 A 记录修改为 CNAME 记录即可</font></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222342691.png" alt="image-20250422234230027"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222342418.png" alt="image-20250422234246144"></p><p><font style="color:#262626">ping ⼀下域名，会发现已经通过 CDN 来进行加速。</font></p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment"># 在没有添加解析出来的地址为 1.13.187.120</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token comment"># 南京的云服务器访问</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment"># 在添加 CDN 之后解析出来的地址为 test.zhanglongfei.cloud.eo.dnse1.com 43.141.132.244  </span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># ping test.zhanglongfei.cloud</span></pre></td></tr><tr><td data-num="6"></td><td><pre>PING test.zhanglongfei.cloud.eo.dnse1.com <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.</pre></td></tr><tr><td data-num="7"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.32</span> ms</pre></td></tr><tr><td data-num="8"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.31</span> ms</pre></td></tr><tr><td data-num="9"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">3</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.33</span> ms</pre></td></tr><tr><td data-num="10"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">4</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.33</span> ms</pre></td></tr><tr><td data-num="11"></td><td><pre></pre></td></tr><tr><td data-num="12"></td><td><pre><span class="token comment"># vm 虚拟机访问</span></pre></td></tr><tr><td data-num="13"></td><td><pre><span class="token punctuation">[</span>root@devsvr ~<span class="token punctuation">]</span><span class="token comment"># ping test.zhanglongfei.cloud</span></pre></td></tr><tr><td data-num="14"></td><td><pre>PING test.zhanglongfei.cloud.eo.dnse1.com <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.</pre></td></tr><tr><td data-num="15"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">183.131</span>.59.181 <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">15.7</span> ms</pre></td></tr><tr><td data-num="16"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">183.131</span>.59.181 <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">16.4</span> ms</pre></td></tr></table></figure><p><strong><font style="color:#DF2A3F">2.GithubPage 配置：源站类型为源站域名 ( <a target="_blank" rel="noopener" href="http://longfeizhang163.github.io">longfeizhang163.github.io</a> )</font></strong></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222343361.png" alt="image-20250422234353076"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222344265.png" alt="image-20250422234421055"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222344883.png" alt="image-20250422234435719"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222344581.png" alt="image-20250422234451254"></p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment"># 配置 CDN 之前</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># ping blog.zhanglongfei.cloud</span></pre></td></tr><tr><td data-num="3"></td><td><pre>PING longfeizhang163.github.io <span class="token punctuation">(</span><span class="token number">185.199</span>.108.153<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.</pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token number">64</span> bytes from cdn-185-199-108-153.github.com <span class="token punctuation">(</span><span class="token number">185.199</span>.108.153<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">51</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">94.6</span> ms</pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token number">64</span> bytes from cdn-185-199-108-153.github.com <span class="token punctuation">(</span><span class="token number">185.199</span>.108.153<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">51</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">95.2</span> ms</pre></td></tr><tr><td data-num="6"></td><td><pre><span class="token number">64</span> bytes from cdn-185-199-108-153.github.com <span class="token punctuation">(</span><span class="token number">185.199</span>.108.153<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">3</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">51</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">93.8</span> ms</pre></td></tr><tr><td data-num="7"></td><td><pre></pre></td></tr><tr><td data-num="8"></td><td><pre><span class="token comment"># 配置 CDN 之后</span></pre></td></tr><tr><td data-num="9"></td><td><pre><span class="token punctuation">[</span>root@VM-0-2-tencentos ~<span class="token punctuation">]</span><span class="token comment"># ping blog.zhanglongfei.cloud</span></pre></td></tr><tr><td data-num="10"></td><td><pre>PING blog.zhanglongfei.cloud.eo.dnse1.com <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.</pre></td></tr><tr><td data-num="11"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.37</span> ms</pre></td></tr><tr><td data-num="12"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.31</span> ms</pre></td></tr><tr><td data-num="13"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">43.141</span>.132.244 <span class="token punctuation">(</span><span class="token number">43.141</span>.132.244<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">3</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">58</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">1.34</span> ms</pre></td></tr><tr><td data-num="14"></td><td><pre></pre></td></tr><tr><td data-num="15"></td><td><pre><span class="token comment"># 配置 CDN 之后</span></pre></td></tr><tr><td data-num="16"></td><td><pre><span class="token punctuation">[</span>root@devsvr ~<span class="token punctuation">]</span><span class="token comment"># ping blog.zhanglongfei.cloud</span></pre></td></tr><tr><td data-num="17"></td><td><pre>PING blog.zhanglongfei.cloud.eo.dnse1.com <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.</pre></td></tr><tr><td data-num="18"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">183.131</span>.59.181 <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">16.7</span> ms</pre></td></tr><tr><td data-num="19"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">183.131</span>.59.181 <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">17.5</span> ms</pre></td></tr><tr><td data-num="20"></td><td><pre><span class="token number">64</span> bytes from <span class="token number">183.131</span>.59.181 <span class="token punctuation">(</span><span class="token number">183.131</span>.59.181<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">3</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">16.8</span> ms</pre></td></tr></table></figure><h1 id="font-stylecolor1dc0c9hexo文章编写与自动发布技巧font"><a class="anchor" href="#font-stylecolor1dc0c9hexo文章编写与自动发布技巧font">#</a> <font style="color:#1DC0C9">Hexo 文章编写与自动发布技巧</font></h1><h2 id="font-stylecolor1dc0c9为新创建的文章自动添加注解font"><a class="anchor" href="#font-stylecolor1dc0c9为新创建的文章自动添加注解font">#</a> <font style="color:#1DC0C9">为新创建的文章自动添加注解</font></h2><p>在前面，每篇文章编写都需要手动，为其添加分类和标签等元数据信息，这个过程非常繁琐。为了简化操作，我们可以通过修改 Hexo 的 scaffold 模板文件来实现自动化。当运行 hexo new post 创建文章时，<font style="color:#DF2A3F">Hexo 会根据模板自动添加元数据信息，例如：文章的标题、分类、标签等，从而大幅提升写作效率。</font></p><p>1. 编辑 <code>scaffolds/post.md</code> 模板文件，用于定义文章默认的初始内容。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token function">vim</span> /e/hexo-blog/scaffolds/post.md</pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre>---</pre></td></tr><tr><td data-num="4"></td><td><pre>title: <span class="token operator">&lt;</span><span class="token operator">!</span>--swig￼0--<span class="token operator">></span></pre></td></tr><tr><td data-num="5"></td><td><pre>date: <span class="token operator">&lt;</span><span class="token operator">!</span>--swig￼1--<span class="token operator">></span></pre></td></tr><tr><td data-num="6"></td><td><pre>categories:</pre></td></tr><tr><td data-num="7"></td><td><pre>  - 默认分类</pre></td></tr><tr><td data-num="8"></td><td><pre>tags:</pre></td></tr><tr><td data-num="9"></td><td><pre>  - 默认tags</pre></td></tr><tr><td data-num="10"></td><td><pre>comments: <span class="token boolean">true</span>  <span class="token comment"># 开启评论</span></pre></td></tr><tr><td data-num="11"></td><td><pre>password: <span class="token string">''</span>    <span class="token comment"># 定义文章的加密密码</span></pre></td></tr><tr><td data-num="12"></td><td><pre>sticky: <span class="token boolean">true</span>    <span class="token comment"># 文章置顶，如果不用则删除，避免文章不显示</span></pre></td></tr><tr><td data-num="13"></td><td><pre>cover: <span class="token string">''</span>       <span class="token comment"># 自定义文章封面，尺寸 350x150，不设置则随机图片为封面</span></pre></td></tr><tr><td data-num="14"></td><td><pre>---</pre></td></tr></table></figure><p>2. 使用命令创建一个新的文章。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>$ hexo new post <span class="token string">"文章标题"</span> <span class="token parameter variable">-p</span> <span class="token string">"自定义文件夹/文件名称"</span> </pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre>$ hexo new post <span class="token string">"Docker容器"</span> <span class="token parameter variable">-p</span> <span class="token string">"docker/01 Docker容器介绍"</span></pre></td></tr><tr><td data-num="4"></td><td><pre>INFO  Validating config</pre></td></tr><tr><td data-num="5"></td><td><pre>INFO  Created: E:<span class="token punctuation">\</span>hexo-blog<span class="token punctuation">\</span>source<span class="token punctuation">\</span>_posts<span class="token punctuation">\</span>docker<span class="token punctuation">\</span>01 Docker容器介绍.md</pre></td></tr></table></figure><h2 id="font-stylecolor1dc0c9使用typora加载文章目录font"><a class="anchor" href="#font-stylecolor1dc0c9使用typora加载文章目录font">#</a> <font style="color:#1DC0C9">使用 typora 加载文章目录</font></h2><p>1. 使用 typora 加载对应文档的路径，点击文件 --&gt; 打开文件夹 --&gt; 加载 /e/hexo-blog/source 文件夹</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222345244.png" alt="image-20250422234547010"></p><p><font style="color:#262626">2. 编写对应的文章</font></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222346784.png" alt="image-20250422234600618"></p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>---</pre></td></tr><tr><td data-num="2"></td><td><pre>title: Docker容器介绍</pre></td></tr><tr><td data-num="3"></td><td><pre>categories:</pre></td></tr><tr><td data-num="4"></td><td><pre>  - Docker</pre></td></tr><tr><td data-num="5"></td><td><pre>tags:</pre></td></tr><tr><td data-num="6"></td><td><pre>  - Docker</pre></td></tr><tr><td data-num="7"></td><td><pre>  - 容器</pre></td></tr><tr><td data-num="8"></td><td><pre>comments: <span class="token boolean">true</span></pre></td></tr><tr><td data-num="9"></td><td><pre>password: <span class="token string">''</span></pre></td></tr><tr><td data-num="10"></td><td><pre>sticky: <span class="token boolean">true</span></pre></td></tr><tr><td data-num="11"></td><td><pre>cover: <span class="token string">''</span></pre></td></tr><tr><td data-num="12"></td><td><pre>date: <span class="token number">2025</span>-04-13 <span class="token number">12</span>:00:38</pre></td></tr><tr><td data-num="13"></td><td><pre>---</pre></td></tr></table></figure><p>3. 本地执行 <code>hexo clean &amp;&amp; hexo server</code> ，检查的分类、tag、以及内容。</p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222349360.png" alt="image-20250422234917829"></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222349603.png" alt="image-20250422234933081"></p><h2 id="font-stylecolor1dc0c9执行部署命令发布文章font"><a class="anchor" href="#font-stylecolor1dc0c9执行部署命令发布文章font">#</a> <font style="color:#1DC0C9">执行部署命令发布文章</font></h2><p>1. 执行发布命令</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>hexo clean <span class="token operator">&amp;&amp;</span> hexo generate <span class="token operator">&amp;&amp;</span> hexo deploy <span class="token operator">&amp;&amp;</span> hexo algolia</pre></td></tr></table></figure><p>2. 检查文章是否更新到线上 <a href="https://blog.zhanglongfei.cloud/">https://blog.zhanglongfei.cloud/</a></p><p><img loading="lazy" data-src="https://zlf-blog.oss-cn-hangzhou.aliyuncs.com/2025/04/202504222350738.png" alt="image-20250422235038173"></p><div class="tags"><a href="/tags/Hexo%E9%A1%B9%E7%9B%AE%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/" rel="tag"><i class="ic i-tag"></i>Hexo项目自动部署</a></div></div><footer><div class="meta"><span class="icon"><i class="ic i-eye"></i></span><span>此文章已被阅读次数:</span><span class="waline-pageview-count" id="twikoo_visitors" data-path="/posts/3061789372.html">正在加载...</span><span class="item"><span class="icon"><i class="ic i-calendar-check"></i></span><span class="text">更新于</span><time title="修改时间：2025-04-23 00:14:42" itemprop="dateModified" datetime="2025-04-23T00:14:42+08:00">2025-04-23</time></span></div><div class="reward"><button><i class="ic i-heartbeat"></i>赞赏</button><p>请我喝[茶]~(￣▽￣)~*</p><div id="qr"><div><img loading="lazy" data-src="/assets/wechatpay.png" alt="LinuxLearner 微信支付"><p>微信支付</p></div><div><img loading="lazy" data-src="/assets/alipay.png" alt="LinuxLearner 支付宝"><p>支付宝</p></div></div></div><div id="copyright"><ul><li class="author"><strong>本文作者：</strong>LinuxLearner<i class="ic i-at"><em>@</em></i>LinuxSre云原生</li><li class="link"><strong>本文链接：</strong><a href="http://blog.zhanglongfei.cloud/posts/3061789372.html" title="Hexo项目自动部署">http://blog.zhanglongfei.cloud/posts/3061789372.html</a></li><li class="license"><strong>版权声明：</strong>本站所有文章除特别声明外，均采用 <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"><i class="ic i-creative-commons"><em>(CC)</em></i>BY-NC-SA</a> 许可协议。转载请注明出处！</li></ul></div></footer></article></div><div class="post-nav"><div class="item left"><a href="/posts/1378412876.html" rel="prev" itemprop="url" data-background-image="https:&#x2F;&#x2F;tva3.sinaimg.cn&#x2F;mw690&#x2F;6833939bly1gicit4jrvuj20zk0m8785.jpg" title="Hexo主题安装及配置"><span class="type">上一篇</span><span class="category"><i class="ic i-flag"></i>Hexo</span><h3>Hexo主题安装及配置</h3></a></div><div class="item right"></div></div><div class="wrap" id="comments"></div></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#font-stylecolor1dc0c9hexo%E9%A1%B9%E7%9B%AE%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2font"><span class="toc-number">1.</span> <span class="toc-text">Hexo 项目自动部署</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E9%83%A8%E7%BD%B2hexo%E8%87%B3githubpages%E6%AD%A5%E9%AA%A4font"><span class="toc-number">1.1.</span> <span class="toc-text">部署 Hexo 至 GithubPages 步骤</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E9%83%A8%E7%BD%B2hexo%E8%87%B3githubpages%E5%AE%9E%E6%88%98font"><span class="toc-number">1.2.</span> <span class="toc-text">部署 Hexo 至 GithubPages 实战</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E4%B8%BAgithub%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E8%87%AA%E5%AE%9A%E4%B9%89%E5%9F%9F%E5%90%8Dfont"><span class="toc-number">1.3.</span> <span class="toc-text">为 Github 项目配置自定义域名</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E4%B8%BA%E8%87%AA%E5%AE%9A%E4%B9%89%E5%9F%9F%E5%90%8D%E5%90%AF%E7%94%A8httpsfont"><span class="toc-number">1.4.</span> <span class="toc-text">为自定义域名启用 https</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#font-stylecolor1dc0c9%E9%83%A8%E7%BD%B2hexo%E9%A1%B9%E7%9B%AE%E8%87%B3linuxfont"><span class="toc-number">2.</span> <span class="toc-text">部署 Hexo 项目至 Linux</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E9%83%A8%E7%BD%B2hexo%E9%A1%B9%E7%9B%AE%E8%87%B3linux%E4%BB%8B%E7%BB%8Dfont"><span class="toc-number">2.1.</span> <span class="toc-text">部署 Hexo 项目至 Linux 介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E9%83%A8%E7%BD%B2hexo%E9%A1%B9%E7%9B%AE%E8%87%B3linux%E5%AE%9E%E6%88%98font"><span class="toc-number">2.2.</span> <span class="toc-text">部署 Hexo 项目至 Linux 实战</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#font-stylecolor1dc0c9hexo%E9%A1%B9%E7%9B%AE%E6%8E%A5%E5%85%A5cdn%E5%8A%A0%E9%80%9F%E6%9C%8D%E5%8A%A1font"><span class="toc-number">3.</span> <span class="toc-text">Hexo 项目接入 CDN 加速服务</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E4%B8%BA%E4%BD%95%E9%9C%80%E8%A6%81%E6%8E%A5%E5%85%A5cdnfont"><span class="toc-number">3.1.</span> <span class="toc-text">为何需要接入 CDN</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E8%87%AA%E6%89%98%E7%AE%A1linux%E6%8E%A5%E5%85%A5cdn%E6%B5%81%E7%A8%8Bfont"><span class="toc-number">3.2.</span> <span class="toc-text">自托管 Linux 接入 CDN 流程</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9githubpage%E6%8E%A5%E5%85%A5cdn%E6%B5%81%E7%A8%8Bfont"><span class="toc-number">3.3.</span> <span class="toc-text">GithubPage 接入 CDN 流程</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E9%85%8D%E7%BD%AE%E7%BD%91%E7%AB%99%E6%8E%A5%E5%85%A5cdn%E5%8A%A0%E9%80%9F%E6%9C%8D%E5%8A%A1font"><span class="toc-number">3.4.</span> <span class="toc-text">配置网站接入 CDN 加速服务</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#font-stylecolor1dc0c9hexo%E6%96%87%E7%AB%A0%E7%BC%96%E5%86%99%E4%B8%8E%E8%87%AA%E5%8A%A8%E5%8F%91%E5%B8%83%E6%8A%80%E5%B7%A7font"><span class="toc-number">4.</span> <span class="toc-text">Hexo 文章编写与自动发布技巧</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E4%B8%BA%E6%96%B0%E5%88%9B%E5%BB%BA%E7%9A%84%E6%96%87%E7%AB%A0%E8%87%AA%E5%8A%A8%E6%B7%BB%E5%8A%A0%E6%B3%A8%E8%A7%A3font"><span class="toc-number">4.1.</span> <span class="toc-text">为新创建的文章自动添加注解</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E4%BD%BF%E7%94%A8typora%E5%8A%A0%E8%BD%BD%E6%96%87%E7%AB%A0%E7%9B%AE%E5%BD%95font"><span class="toc-number">4.2.</span> <span class="toc-text">使用 typora 加载文章目录</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-stylecolor1dc0c9%E6%89%A7%E8%A1%8C%E9%83%A8%E7%BD%B2%E5%91%BD%E4%BB%A4%E5%8F%91%E5%B8%83%E6%96%87%E7%AB%A0font"><span class="toc-number">4.3.</span> <span class="toc-text">执行部署命令发布文章</span></a></li></ol></li></ol></div><div class="related panel pjax" data-title="系列文章"><ul><li><a href="/posts/757210256.html" rel="bookmark" title="Hexo介绍及安装">Hexo介绍及安装</a></li><li><a href="/posts/3617638497.html" rel="bookmark" title="Hexo配置及迁移">Hexo配置及迁移</a></li><li><a href="/posts/1378412876.html" rel="bookmark" title="Hexo主题安装及配置">Hexo主题安装及配置</a></li><li class="active"><a href="/posts/3061789372.html" rel="bookmark" title="Hexo项目自动部署">Hexo项目自动部署</a></li></ul></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" loading="lazy" decoding="async" itemprop="image" alt="LinuxLearner" src="/assets/avatar.jpg"><p class="name" itemprop="name">LinuxLearner</p><div class="description" itemprop="description">这是一个LinuxSre相关的技术博客</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">13</span><span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">5</span><span class="name">分类</span></a></div><div class="item tags"><a href="/tags/"><span class="count">10</span><span class="name">标签</span></a></div></nav><div class="social"><a target="_blank" rel="noopener" href="https://github.com/yourname" class="item github" title="https:&#x2F;&#x2F;github.com&#x2F;yourname"><i class="ic i-github"></i></a><a href="mailto:zlf1570380578@163.com" class="item email" title="mailto:zlf1570380578@163.com"><i class="ic i-envelope"></i></a></div><div class="menu"><li class="item"><a href="/" rel="section"><i class="ic i-home"></i>首页</a></li><li class="item"><a href="/archives/" rel="section"><i class="ic i-list-alt"></i>归档</a></li><li class="item"><a href="/categories/" rel="section"><i class="ic i-th"></i>分类</a></li><li class="item"><a href="/tags/" rel="section"><i class="ic i-tags"></i>标签</a></li><li class="item"><a href="/about/" rel="section"><i class="ic i-about"></i>关于</a></li><li class="item"><a href="/friends/" rel="section"><i class="ic i-heart"></i>友链</a></li></div></div></div></div><ul id="quick"><li class="prev pjax"></li><li class="up"><i class="ic i-arrow-up"></i></li><li class="down"><i class="ic i-arrow-down"></i></li><li class="next pjax"><a href="/posts/1378412876.html" rel="next" title="下一篇"><i class="ic i-chevron-right"></i></a></li><li class="percent"></li></ul></div></div><div class="dimmer"></div></div></main><footer id="footer"><div class="inner"><div class="widgets"><div class="rpost pjax"><h2>随机文章</h2><ul><li class="item"><div class="breadcrumb"><a href="/categories/Linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" title="分类于Linux基础知识">Linux基础知识</a></div><span><a href="/posts/3049183777.html">04.Linux文件管理</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Hexo/" title="分类于Hexo">Hexo</a></div><span><a href="/posts/757210256.html">Hexo介绍及安装</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/ELK/" title="分类于ELK">ELK</a><i class="ic i-angle-right"></i><a href="/categories/ELK/filebeat/" title="分类于filebeat">filebeat</a></div><span><a href="/posts/804899506.html">Filebeat入门</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" title="分类于Linux基础知识">Linux基础知识</a></div><span><a href="/posts/3693312163.html">Lepus监控数据库</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Hexo/" title="分类于Hexo">Hexo</a></div><span><a href="/posts/1378412876.html">Hexo主题安装及配置</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Hexo/" title="分类于Hexo">Hexo</a></div><span><a href="/posts/3061789372.html">Hexo项目自动部署</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Linux%E5%9F%BA%E7%A1%80/" title="分类于Linux基础">Linux基础</a></div><span><a href="/posts/1916920075.html">课程规划</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" title="分类于Linux基础知识">Linux基础知识</a></div><span><a href="/posts/3847727083.html">01.Linux历史介绍</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" title="分类于Linux基础知识">Linux基础知识</a></div><span><a href="/posts/2594899394.html">03.LinuxShell初识</a></span></li><li class="item"><div class="breadcrumb"><a href="/categories/Linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" title="分类于Linux基础知识">Linux基础知识</a></div><span><a href="/posts/454805913.html">02.Linux系统安装</a></span></li></ul></div><div class="rpost pjax"><h2>最新评论</h2><ul class="leancloud-recent-comment" id="new-comment"></ul></div></div><div class="status"><div class="copyright">&copy; 2025 -<span itemprop="copyrightYear">2025</span><span class="with-love"><i class="ic i-sakura rotate"></i></span><span class="author" itemprop="copyrightHolder">LinuxLearner @ hexo-blog</span></div><div class="count"><span class="post-meta-item-icon"><i class="ic i-chart-area"></i></span><span title="站点总字数">78k 字</span><span class="post-meta-divider"> | </span><span class="post-meta-item-icon"><i class="ic i-coffee"></i></span><span title="站点阅读时长">1:11</span></div><div class="powered-by">基于 <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a> & Theme.<a target="_blank" rel="noopener" href="https://github.com/theme-shoka-x/hexo-theme-shokaX/">ShokaX</a></div><br><span style="display:inline;height:20px;line-height:20px;margin:0 0 0 5px;color:var(--grey-5)"><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn">xxx</a><br><a target="_blank" href="https://beian.mps.gov.cn/#/query/webSearch?code=xxx"><img loading="lazy" decoding="async" data-src="/assets/" style="max-width:2em;display:inline" width="20" height="20" alt="备案">xxx</a></span></div></div></footer></div><script data-config type="text/javascript">var LOCAL = {
    ispost: true,
        path: `posts/3061789372.html`,
        favicon: {
        show: `（●´3｀●）やれやれだぜ`,
        hide: `(´Д｀)大変だ！`
    },
    search: {
        placeholder: "文章搜索",
        empty: "关于 「 ${query} 」，什么也没搜到",
        stats: "${time} ms 内找到 ${hits} 条结果"
    },
    copy_tex: false,
    katex: false,
    mermaid: false,
    audio: undefined,
    fancybox: true,
    nocopy: false,
    outime: true,
    template: `<div class="note warning"><p><span class="label warning">文章时效性提示</span><br>这是一篇发布于 {{publish}} 天前，最后一次更新在 {{updated}} 天前的文章，部分信息可能已经发生改变，请注意甄别。</p></div>`,
    quiz: {
        choice: `单选题`,
        multiple: `多选题`,
        true_false: `判断题`,
        essay: `问答题`,
        gap_fill: `填空题`,
        mistake: `错题备注`
    },
    ignores: [
        (uri) => uri.includes('#'),
        (uri) => new RegExp(LOCAL.path + '$').test(uri),
            []
    ]
};</script><script src="https://s4.zstatic.net/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha384-k6YtvFUEIuEFBdrLKJ3YAUbBki333tj1CSUisai5Cswsg9wcLNaPzsTHDswp4Az8" crossorigin="anonymous" fetchpriority="high"></script><script src="https://s4.zstatic.net/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha384-ZvpUoO&#x2F;+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn&#x2F;6Z&#x2F;hRTt8+pR6L4N2" crossorigin="anonymous" fetchpriority="high"></script><script src="/js/siteInit.js?v=0.4.17" type="module" fetchpriority="high" defer></script></body></html><!-- rebuild by hrmmi -->